<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/pages/safeai/jsp/common/taglibs.jsp"%>

<html>
<head>
<title>过滤器</title>
<script type='text/javascript' src='${ctx}/dwr/interface/filterService.js'></script>
<script type='text/javascript' src='${ctx}/dwr/engine.js'></script>
<script type="text/javascript" src="${ctx}/script/common/common.js"></script>
<script type="text/javascript" src="${ctx}/script/product/catalog.js"></script>
<%@ include file="/pages/safeai/jsp/common/meta.jsp"%>
<link href="${ctx}/css/safeai/together.css" rel="stylesheet" type="text/css">
</head>
 <body>
 	<form name="" action="" method="post">
 	<bean:define id="helper" value="filterService"/>
	<bean:define id="namesacpe" value="filter_sqlMap"/>
    <table id="searchList" width="819px" align="center">
		<tr>
				<th class="td_01" width="65px" height="25px" nowrap>名称</th>
				<th class="td_01" nowrap width="69px" nowrap>过滤器顺序</th>
		    	<th class="td_01" width="92px" nowrap>类型</th>
		    	<th class="td_01" width="67px" nowrap>单位</th>
		    	<th class="td_01" width="87px" nowrap>可选值</th>
		    	<th class="td_01" width="55px" nowrap>状态</th>
		    	<th class="td_01" width="100px" nowrap>关键字</th>
				<th class="td_01" width="79px" nowrap>取值模式</th>
				<th class="td_01" width="79px" nowrap>值类型</th>
		    	<th class="td_01" width="79px" nowrap>操作符模式</th>
		    	
		    	<th  class="td_01" width="39px" nowrap>操作</th>
	   </tr>
	   <logic:present name="FilterRange">
	   		<logic:iterate id="filter" name="FilterRange">
		   			<tr valign="middle" identity="${filter.id}" helper="${helper}" namespace="${namesacpe}">
		   			<td style="display:none" ><input type="hidden" name="catalogid" value="${ filter.catalogid}"/></td>
					<td class="td_03" width="65px" nowrap><input type="text" size="5" name="name"  value="${filter.name }" maxlength="50"></td>
			    	<td class="td_03" width="69px" nowrap><input type="text" size="5" name="sequence" value="${filter.sequence }" ></td>
			    	
			    	<td readonly="1" class="td_03" width="92px" nowrap>
			    		<span id="fix_type">
							${filter.type}
						</span>
					</td>
			    	<td class="td_03" width="67px" nowrap><input type="text" size="5" name="unit"  value="${filter.unit }" maxlength="20"></td>
					<td class="td_03" width="87px" nowrap><textarea name="value" rows="4" cols="8">${filter.value}</textarea></td>
			    	<td class="td_03" width="55px" nowrap>
						<select name="status">
							<option value="1">暂停</option>
							<option value="0" <logic:notEqual name="filter" property="status" value="1">selected</logic:notEqual>>正常</option>
						</select> 
					</td>
					<td class="td_03" readonly="1" width="100px" nowrap>
						<span id="fix_type">	
							${filter.keywords}
						</span>
					</td>
					<td class="td_03" width="79px" nowrap>
						<select name="valuetype">
							<option value="0">手工设值</option>
							<option value="1" <logic:notEqual name="filter" property="valuetype"  value="0">selected</logic:notEqual>>自动取值</option>
						</select>
					</td>
					<td class="td_03" width="79px" nowrap>
						<select name="valuemode">
							<option value="0">直接取值</option>
							<option value="1"<logic:notEqual name="filter" property="valuemode"  value="0">selected</logic:notEqual>>范围取值</option>
						</select>
					</td>
					<td class="td_03" width="79px" nowrap>
						<select name="valueoper">
							<option value="0"<logic:equal name="filter" property="valueoper"  value="0">selected</logic:equal>>严格匹配</option>
							<option value="1"<logic:equal name="filter" property="valueoper"  value="1">selected</logic:equal>>范围匹配</option>
							<option value="2"<logic:equal name="filter" property="valueoper"  value="2">selected</logic:equal>>模糊匹配</option>
						</select>
					</td>
					
					<td class="td_03" id="operator" width="39px" nowrap>
						<a href='javascript:void(0);' onclick='javascript:update(this);'>修改</a><br /><br />
						<a href='javascript:void(0);' onclick='javascript:remove(this);'>删除</a>
					</td>
					</tr>
	   		</logic:iterate>
	   </logic:present>
	  </table>
	  <br />
	<table width="819px" align="center">
   		<tr id="filter">
   			<td style="display:none"><input type="hidden" name="catalogid" value="${ selected}"/></td>
			<td class="td_01" width="65px"><input type="text" size="5" name="name" maxlength="50" ></td>
	    	<td  class="td_01" width="69px"><input type="text" size="5" name="sequence" /></td>
	    	<td width="92px" class="td_01" immutable="1" >
	    		
				<select name="type" onChange="t('filter');" >
					<option value="0">子类过滤器</option>
					<option value="1">品牌过滤器</option>
					<option value="2">价格过滤器</option>
					<option value="3">可搜索内容</option>
				</select>
			</td>
	    	<td class="td_01" width="67px"><input type="text" size="5" name="unit" maxlength="20"></td>
			<td class="td_01" width="87px"><textarea name="value" rows="4" cols="8"></textarea></td>
	    	<td class="td_01" width="55px">
				<select name="status">
					<option value="1">暂停</option>
					<option value="0">正常</option>
				</select>
			</td>
			<td class="td_01" immutable="1" width="100px">	
				<select name="keywords"  multiple="multiple" style="width: 100px;display:none;" >
					<logic:present name="SearchDetailRange">
						<logic:iterate id="SearchDetail" name="SearchDetailRange" indexId="index">
							<option value="${ SearchDetail.keywords}" >${ SearchDetail.name}</option>
						</logic:iterate>
					</logic:present>
				</select>
			</td>
			<td class="td_01" width="79px">
				<select name="valuetype">
					<option value="0">手工设值</option>
					<option value="1">自动取值</option>
				</select>
			</td>
			<td class="td_01" width="79px">
				<select name="valuemode">
					<option value="0">直接取值</option>
					<option value="1">范围取值</option>
				</select>
			</td>
			<td class="td_01" width="79px">
				<select name="valueoper">
					<option value="0" >严格匹配</option>
					<option value="1">范围匹配</option>
					<option value="2">模糊匹配</option>

				</select>
			</td>
			
			<td class="td_01" id="operator" width="39px">
				<input type="button" class="btn" name="button" value="添加" onclick="javascript:addRecord('filter', 'searchList','${namesacpe}','${helper}')"/>
			</td>
	</tr>
</table>
</form>
 </body>
</html>
